package com.ymatou.iapi.csim.testcase;

import com.ymatou.iapi.csim.parameter.IsPspSellerBatchCheckBean;
import com.ymatou.iapi.csim.service.IsPspSellerBatchCheckCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.annotation.TestSuite;
import com.ymt.utils.tag.P1;
import org.junit.*;
import org.junit.experimental.categories.Category;

import java.util.Arrays;

/**
*是否精选买手
*FreeMaker Template自动生成代码
*/
@TestSuite
public class Ts_IsPspSellerBatchCheck{
	private static IsPspSellerBatchCheckBean ispspsellerbatchcheckBean;
	private static IsPspSellerBatchCheckCall ispspsellerbatchcheckCall;
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("是否精选买手");
	}

	@Before
	public void caseUp() {
		ispspsellerbatchcheckBean=new IsPspSellerBatchCheckBean();
		ispspsellerbatchcheckCall=new IsPspSellerBatchCheckCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(ispspsellerbatchcheckCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_IsPspSellerBatchCheck_001() {
		Logger.start(true,"是否精选买手，");
		try {
			int sellerId1 = 3383;
			//int sellerId2 = 288484;
			ispspsellerbatchcheckBean.setSellerIdList(Arrays.asList(sellerId1));
			ispspsellerbatchcheckCall.setData(ispspsellerbatchcheckBean);
			ispspsellerbatchcheckCall.callService();	
			
			//验证
			Logger.verifyEquals("0", ispspsellerbatchcheckCall.getResult().get("ErrorCode").toString(), "验证errorCode");
			Logger.verifyEquals(true, ispspsellerbatchcheckCall.getResult().get("Success"), "验证Success");
			Logger.verifyEquals("200", ispspsellerbatchcheckCall.getStatus(), "验证Status");
			
			Logger.verifyEquals(true, ispspsellerbatchcheckCall.getResult().getJSONArray("EnableList").contains(sellerId1), "验证EnableList");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}